package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

@RestController
//@CrossOrigin    //解决跨域问题
@RequestMapping("/eduservice/user")
@Api(description="登录验证")
public class EduLoginController {

    //login
    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }

    //info
    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles","admin").data("name","李光耀").data("avatar","http://www.weixintouxiang.cn/weixin/20140607090832328.gif");
    }

}
